<template>
  <div>
    <el-form :model="formInline" label-width="80px">
      <el-form-item label="用户名">
        <el-input v-model.trim="formInline.Name" placeholder="用户名"></el-input>
      </el-form-item>
      <el-form-item label="描述">
        <el-input v-model="formInline.Description" placeholder="描述"></el-input>
      </el-form-item>
      <el-form-item label="排序">
        <el-input v-model.number="formInline.Sort" placeholder="排序"></el-input>
      </el-form-item>
      <el-form-item class="editdata_button">
        <el-button type="primary" @click="AddSubmit">保存</el-button>
        <el-button type="default" @click="AddCancle">取消</el-button>
        <el-button type="warning" @click="AddClear">清空</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import { mixinAddMixed } from "@/mixedObject/addMixed";
export default {
  mixins:[mixinAddMixed],
  data() {
    return {};
  },
  created() {
    //初始化表单
    this.InitFormInLine();
  },
  methods: {
    //初始化
    InitFormInLine() {
      this.formInline = {
        Name: "",
        Description: "",
        Sort: 0,
      };
    },
    //保存
    AddSubmit() {
      this.$store
        .dispatch("role/AddEditRoleInfo", this.formInline)
        .then(data => {
          //回调事件
          this.$emit("SuccessReturn", { type: "add", isSelect: true });
        });
    }
  }
};
</script>

<style lang="scss" scoped>
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
</style>